package com.ekuaitu.kuaitu.ble;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.os.ParcelUuid;

import java.util.UUID;

/**
 * Created by Michael Pi on 2017/1/11.
 */

public class BTUtils {

    private static class BTUtilsHolder {
        private static final BTUtils INSTANCE = new BTUtils();
    }

    private BTUtils() {

    }

    public static final BTUtils getInstance() {
        return BTUtilsHolder.INSTANCE;
    }




    public class DataClass {
        public BluetoothDevice device = null;
        public String name;
        public Integer rssi = 0;
    }


    private DataClass m_myData = new DataClass();

    BluetoothAdapter mBluetoothAdapter;
    BluetoothGattCharacteristic writeCharacteristic;
    BluetoothGattCharacteristic readCharacteristic;
    BluetoothGatt mBluetoothGatt;
    volatile int caozuo = 0;

    public static final ParcelUuid findServerUUID = ParcelUuid.fromString("0000fee7-0000-1000-8000-00805f9b34fb");
    public static final UUID OAD_SERVICE_UUID = UUID.fromString("f000ffc0-0451-4000-b000-000000000000");

    public static final UUID bltServerUUID = UUID.fromString("0000fee7-0000-1000-8000-00805f9b34fb");
    public static final UUID readDataUUID = UUID.fromString("000036f6-0000-1000-8000-00805f9b34fb");

    public static final UUID CLIENT_CHARACTERISTIC_CONFIG = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");

    public static final UUID writeDataUUID = UUID.fromString("000036f5-0000-1000-8000-00805f9b34fb");

    byte[] btToken = new byte[4];
    byte[] gettoken = {0x06, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
    byte[] loadPwd = new byte[6];
    byte[] loadKey = new byte[16];
    /* byte[] loadKey = {32, 87, 47, 82, 54, 75, 63, 71, 48, 80, 65, 88, 17, 99, 45, 43};
     byte[] loadPwd = {0x30, 0x30, 0x30, 0x30, 0x30, 0x30};*/
    String btMac;

}
